Telegram Group & Telegram Channel
🧱 Для чего нужны плоские контейнеры и как их использовать

💡 В C++23 появились долгожданные «плоские» контейнеры: flat_set, flat_map, flat_multiset и flat_multimap — адаптеры, которые используют обычные векторы вместо деревьев.

❗️ Ключевые особенности:

• поиск O(log N) как в обычном set, но быстрее на практике
• итерация в разы быстрее классических контейнеров
• потребление памяти меньше на сотни процентов
• вставка и удаление катастрофически медленные O(N)

Основная идея — хранить данные в отсортированном векторе и использовать бинарный поиск. std::flat_map даже хранит ключи и значения в отдельных контейнерах для лучшей производительности.

Идеально подходят для сценариев «заполнил один раз — читаю много раз». Особенно эффективны при работе с миллионами элементов и компактными ключами.

⚠️ Не используйте их, если планируете частые вставки и удаления — в таких случаях классические std::set/map или unordered-контейнеры будут эффективнее.

🔜Статья

Библиотека C/C++ разработчика
Please open Telegram to view this post
VIEW IN TELEGRAM



tg-me.com/cppproglib/5770
Create:
Last Update:

🧱 Для чего нужны плоские контейнеры и как их использовать

💡 В C++23 появились долгожданные «плоские» контейнеры: flat_set, flat_map, flat_multiset и flat_multimap — адаптеры, которые используют обычные векторы вместо деревьев.

❗️ Ключевые особенности:

• поиск O(log N) как в обычном set, но быстрее на практике
• итерация в разы быстрее классических контейнеров
• потребление памяти меньше на сотни процентов
• вставка и удаление катастрофически медленные O(N)

Основная идея — хранить данные в отсортированном векторе и использовать бинарный поиск. std::flat_map даже хранит ключи и значения в отдельных контейнерах для лучшей производительности.

Идеально подходят для сценариев «заполнил один раз — читаю много раз». Особенно эффективны при работе с миллионами элементов и компактными ключами.

⚠️ Не используйте их, если планируете частые вставки и удаления — в таких случаях классические std::set/map или unordered-контейнеры будут эффективнее.

🔜Статья

Библиотека C/C++ разработчика

BY Библиотека C/C++ разработчика | cpp, boost, qt




Share with your friend now:
tg-me.com/cppproglib/5770

View MORE
Open in Telegram


Библиотека C C разработчика | cpp boost qt Telegram | DID YOU KNOW?

Date: |

Telegram and Signal Havens for Right-Wing Extremists

Since the violent storming of Capitol Hill and subsequent ban of former U.S. President Donald Trump from Facebook and Twitter, the removal of Parler from Amazon’s servers, and the de-platforming of incendiary right-wing content, messaging services Telegram and Signal have seen a deluge of new users. In January alone, Telegram reported 90 million new accounts. Its founder, Pavel Durov, described this as “the largest digital migration in human history.” Signal reportedly doubled its user base to 40 million people and became the most downloaded app in 70 countries. The two services rely on encryption to protect the privacy of user communication, which has made them popular with protesters seeking to conceal their identities against repressive governments in places like Belarus, Hong Kong, and Iran. But the same encryption technology has also made them a favored communication tool for criminals and terrorist groups, including al Qaeda and the Islamic State.

How To Find Channels On Telegram?

There are multiple ways you can search for Telegram channels. One of the methods is really logical and you should all know it by now. We’re talking about using Telegram’s native search option. Make sure to download Telegram from the official website or update it to the latest version, using this link. Once you’ve installed Telegram, you can simply open the app and use the search bar. Tap on the magnifier icon and search for a channel that might interest you (e.g. Marvel comics). Even though this is the easiest method for searching Telegram channels, it isn’t the best one. This method is limited because it shows you only a couple of results per search.

Библиотека C C разработчика | cpp boost qt from it


Telegram Библиотека C/C++ разработчика | cpp, boost, qt
FROM USA